package com.cn.hu.service;

import java.io.InputStream;
import java.util.List;

import com.cn.hu.entity.Customer;
import com.cn.hu.entity.CustomerContacts;
import com.cn.hu.entity.CustomerDepartment;
import com.cn.hu.entity.Department;
import com.cn.hu.entity.Employee;
import com.cn.hu.entity.Plan;
import com.cn.hu.entity.User;
import com.cn.hu.entity.vo.Result;
import com.cn.hu.entity.vo.SelectResult;


public interface WebService {

	/**
	 * 按照账号查找用户
	 * @param username
	 * @return
	 */
	User findUserByAccount(String username);

	/**
	 * 保存或更新用户
	 * @param u
	 * @return
	 */
	boolean saveOrUpdateUser(User u);

	/**
	 * 查找员工数据对象并返回
	 * @param res
	 * @return
	 */
	Result<Employee, String> loadEmployeeList(Result<Employee, String> res,Employee employee);

	/**
	 * 查找员工列表
	 * @return
	 */
	List<Department> findAllDepartment();

	/**
	 * 保存或更新员工
	 * @param e
	 * @return
	 */
	boolean saveOrUpdateEmployee(Employee e);

	/**
	 * 删除员工，其实只是更新状态不可用
	 * @param delId
	 * @return
	 */
	boolean deleteEmployeeById(Integer delId);

	/**
	 * 查找客户列表
	 * @param res
	 * @param customer
	 * @return
	 */
	Result<Customer, String> loadCustomerList(Result<Customer, String> res,
			Customer customer);

	/**
	 * 添加或更新客户
	 * @param customer
	 * @return
	 */
	boolean saveOrUpdateCustomer(Customer customer);

	/**
	 * 删除客户（伪删除）
	 * @param delId
	 * @return
	 */
	boolean deleteCustomer(int delId);

	/**
	 * 读取客户联系人列表
	 * @param res
	 * @param contacts
	 * @return
	 */
	Result<CustomerContacts, String> loadCustomerContactsList( 
			Result<CustomerContacts, String> res, CustomerContacts contacts,Integer customerId);

	/**
	 * 将excel读取到列表并返回展示
	 * @param stream
	 * @return
	 */
	Result<Plan, String> loadExcelToList(InputStream stream,int excelType); 

	/**
	 * 读取所有员工
	 * @return
	 */
	List<Employee> findEmployeeList();

	/**
	 * 读取所有客户
	 * @return
	 */
	List<Customer> findAllCustomerList();

	/**
	 * 根据客户Id读取部门 result
	 * @param customerId
	 * @return
	 */
	List<CustomerDepartment> findDeparmentListByCustomerId(Integer customerId);

	/**
	 * 根据客户部门Id读取联系人result
	 * @param selectId
	 * @return
	 */
	List<SelectResult> findContactsListByDepId(Integer selectId);

	Result<String, String> checkAddPlanList(List<Plan> planList);

	Result<String, String> savePlanList(List<Plan> planList); 

	
	
}
